﻿using DataAccess.ObjectOne;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Class_Entity.ObjectOne;
namespace BussinessObject.ObjectOne
{    

    public class B_Branches
    {
        
        D_Branches ex = new D_Branches();
        public DataTable LoadDropbox()
        {
            return ex.LoadDropbox();
        }
        public DataTable LoadDropbox1()
        {
            return ex.LoadDropbox1();
        }
        public DataTable LoadDropbox2()
        {
            return ex.LoadDropbox2();
        }
        public DataTable LoadContent(int val)
        {
            return ex.LoadContent(val);
        }
        public C_Branches LoadDetail(int val)
        {
            C_Branches fx = new C_Branches();
            DataTable tb = new DataTable();
            tb = ex.LoadDetail(val);
            foreach (DataRow dr in tb.Rows)
            {
                fx.COMPANY_ID = Convert.ToInt32(dr["COMPANY_ID"].ToString());
                fx.CITY_ID = Convert.ToInt32(dr["CITY_ID"].ToString());
                fx.BRANCH_CODE = dr["BRANCH_CODE"].ToString();
                fx.BRANCH_NAME = dr["BRANCH_NAME"].ToString();
                fx.BRANCH_PHONE = dr["BRANCH_PHONE"].ToString();
                fx.ADDRESS = dr["ADDRESS"].ToString();
                fx.DESCRIPTION = dr["DESCRIPTION"].ToString();
            }
            return fx;
        }
    }
}
